# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: sh0 <mee@sh0.org>

pkgname=iptraf-ng
pkgver=1.1.4
pkgrel=3
pkgdesc='Console-based network monitoring utility'
url='https://sourceforge.net/projects/iptraf-ng/'
arch=('i686' 'x86_64')
depends=('ncurses')
license=('GPL2')
replaces=('iptraf')
source=(https://infrastructure.fedoraproject.org/infra/hosted-content/iptraf-ng/iptraf-ng/iptraf-ng-${pkgver}.tar.gz)
sha256sums=('79140cf07c0cceb1b5723242847a73aa86f5e4f9dccfe8970fda6801d347eb09')
sha512sums=('8cafb0000cec75eb4071156a9e9350ffe6de99cb6386e8f50d05337113872ee50082a30009d85faa02d83633a8e727039791332d600654321b95ca6cfc881774')

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --sbindir=/usr/bin
  # preserve our own flags
  make CFLAGS="${CFLAGS} -std=gnu99" \
    LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}"
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 iptraf-ng-logrotate.conf -t "${pkgdir}/etc/logrotate.d"
}

# vim: ts=2 sw=2 et:
